import { homeConfig } from '@/router/homeConfig.js'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      redirect: '/admin',
    },
    {
      path: '/admin',
      name: 'admin',
      component: () => import('@/views/admin/index.vue'),
      redirect: '/admin/dashboard',
      children: homeConfig,
    },
  ],
})

export default router
